package com.gitee.candy.other;

import java.lang.reflect.Field;

/**
 * @author ：suyanlong
 * @date ：Created in 2020/10/19 19:07
 * @description：特殊例子
 * @version: 1.0
 */
public class SpecialExampleUtils {

    public static void numberOutput() throws NoSuchFieldException, IllegalAccessException {
        Class cache = Integer.class.getDeclaredClasses()[0]; //1
        Field myCache = cache.getDeclaredField("cache"); //2
        myCache.setAccessible(true);//3

        Integer[] newCache = (Integer[]) myCache.get(cache); //4
        newCache[132] = newCache[133]; //5

        int a = 2;
        int b = a + a;
        System.out.printf("%d + %d = %d", a, a, b); //
        System.out.println();
    }

    public static void magicOutput() {
        if (false == true) { //these characters are magic: \u000a\u007d\u007b
            System.out.println("false is true!");
        }
        String name = "沉默王二";
        // \u000dname="沉默王三";
        System.out.println(name);
    }
}
